package lowijs.XfireClient;

import lowijs.XfireClient.util.Util;

@SuppressWarnings("serial")
public class PacketException extends Exception {
	public PacketException(String message, Throwable t, byte[] buffer) {
		super(toMessage(message, buffer), t);
	}

	private static String toMessage(String message, byte[] buffer) {
		return message + "\n\tSize: " + buffer.length + "\n\t" + Util.toHex(buffer, "\n\t", 40);
	}
}
